package org.jetlinks.community.mstn.entity.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jetlinks.community.device.entity.DeviceProperty;

import java.util.ArrayList;
import java.util.List;

@Data
public class DeviceValueResVO {
    @Schema(description = "设备ID")
    private String deviceId;

    @Schema(description = "值")
    private List<DeviceProperty> value;

    public static DeviceValueResVO of(DeviceProperty property) {
        DeviceValueResVO vo = new DeviceValueResVO();
        vo.setDeviceId(property.getDeviceId());
        vo.value = new ArrayList<>();
        return vo.add(property);
    }

    public DeviceValueResVO add(DeviceProperty property) {
        this.value.add(property);
        return this;
    }
}
